import { request } from "@utils/http";
import { Key } from "react";
import {
    gethosSetListParamsType,
    gethosSetListReturnType,
    addHospitalType,
    gethospitalItemType
} from './model/hospitalTypes'

//发送获取分页列表数据请求
export const gethosSetListRequest = ({page,limit,hosname,hoscode}:gethosSetListParamsType)=>{
    return request.get<any,gethosSetListReturnType>(`/admin/hosp/hospitalSet/${page}/${limit}`,{
            params:{
                hosname,
                hoscode
            }
        })
}



// 发送新增医院请求
export const addHospitalRequest = (data:addHospitalType)=>{
    return request.post('/admin/hosp/hospitalSet/save',data)
}

// 发送获取点击修改按钮对应的列表信息
export const gethospitalItemRequest = (id:string)=>{
    return request.get<any,gethospitalItemType>(`/admin/hosp/hospitalSet/get/${id}`)
}

// 发送修改医院请求
export const updataHospitalRequest = (data:gethospitalItemType)=>{
    return request.put<any,null>('/admin/hosp/hospitalSet/update',data)
}


// 发送删除请求
export const deleteHosListRequest = (id:number)=>{
    return request.delete<any,null>(`/admin/hosp/hospitalSet/remove/${id}`)
}

// 发送批量删除请求
export const deleteSomeListRequest = (ids:Key[])=>{
    return request.delete(`/admin/hosp/hospitalSet/batchRemove/`,{
        data:ids
    })
}